<template>
    <div class="box">
        <div class="header">
            <van-nav-bar title="详情" left-arrow @click-left="$router.back()" />
        </div>
        <div class="meddle">
            <img :src="obj.image" alt="" style="width: 100%;">
            <p>{{ obj.title }}</p>
            <p style="color: red;">￥{{ obj.price }}</p>
        </div>
    </div>
</template>
<script setup>

import request from '@/utils/request.js'
    import { ref,onMounted } from "vue";
    const  obj=ref([])
    import { useRoute, useRouter } from 'vue-router'

const router = useRouter()
const route = useRoute()
    onMounted(()=>{
        request.get('/detail',{
            params:{
                id:route.params.id
            }
        }).then(res=>{
            if(res.data.code==200){
                obj.value=res.data.data
            }
        })
    })
</script>